<template>
  <div class="eplist_ep_list_wrapper__Sy5N8">
    <div class="eplist_list_title__48o_y">
      <!--标题部分-->
      <div class="eplist_left_wrap__UFyXT">
        <h4>正片</h4>
        <span class="eplist_ep_list_progress__MXZG2">({{detailList.index}}/{{detailList.videoItems.length}})</span>
      </div>
      <div class="eplist_right_wrap__WaBpF">
        <!--列表按钮图标-->
        <div class="modeChangeBtn_wrap__xihUg">
          <span v-if="intercut" @click="intercut = !intercut"
                class="iconfont icon-liebiao modeChangeBtnspan hover-blue"></span>
          <span v-if="!intercut" @click="intercut = !intercut"
                class="iconfont icon-s-grid modeChangeBtnspan hover-blue"></span>
        </div>
        <span class="eplist_ep_list_order__TfnoF">
          <!--默认降序-->
          <span v-if="markCut2" @click="markCut2 = !markCut2"
                class="iconfont icon-jiangxu modeChangeBtnspan hover-blue"></span>
          <span v-if="!markCut2" @click="markCut2 = !markCut2"
                class="iconfont icon-shengxu modeChangeBtnspan hover-blue"></span>
        </span>
      </div>
    </div>
    <!--视频列表部分  橫排-->
    <div v-if="intercut" class="imageList_wrap___f73Z small-mode">
      <div v-for="(item,index) in detailList.videoItems" :key="index" class="imageListItem_wrap__o28QW">
        <a @click="changeIndex(index + 1,item.videoId);blueHover = index;" :class="{currentColor:blueHover === index,hover_blue:blueHover != index}" :title="'第'+index+'集 '+item.title">
          <div class="imageListItem_coverWrap__evIUp">
            <picture>
              <img alt="" :src="item.imgUrl" class="image_ogv_weslie_common_image">
            </picture>
            <div v-if="item.isVip" style="background-color:#FB7299" class="imageListItem_badge__F9tZQ">会员</div>
            <div v-if="!item.isVip" style="background-color:#00C0FF" class="imageListItem_badge__F9tZQ">预告</div>
          </div>
          <!--标题部分-->
          <div>
            <div :title="'第'+index+'集 '+item.title" class="hover-blue">
              <div class="imageListItem_title__MC0fG imageListItem_shortTitle__yV5mg">第{{ index + 1 }}集</div>
              <div class="imageListItem_title__MC0fG imageListItem_longTitle__I6il0">{{ item.title }}</div>
            </div>
          </div>
        </a>
      </div>
    </div>
    <!--视频列表部分  盒子-->
    <div v-if="!intercut" class="numberList_wrapper___SI4W small-mode">
      <div v-for="(item,index) in detailList.videoItems" :key="index" class="numberListItem_number_list_item__T2VKO"
           :title="index+1">
        <a @click="changeIndex(index + 1,item.videoId);blueHover = index;" :class="{numberListItem_select__WgCVr:blueHover === index,hover_blue:blueHover != index}"  :title="index+1">
          <span class="numberListItem_title__LNXrS">{{ index + 1 }} </span>
          <div v-if="item.isVip" style="background-color:#FB7299" class="numberListItem_badge__Ex_1n">会员</div>
          <div v-if="!item.isVip" style="background-color:#00C0FF" class="numberListItem_badge__Ex_1n">预告</div>
        </a>
      </div>
    </div>

  </div>
</template>

<script>
export default {
  name: "videoEpisodeNext",
  data() {
    return {
      videoEpisodeList: [],
      markCut: true,
      markCut2: true,
      intercut: true,
      index:1
    }
  },
  created() {
  },
  methods: {
    changeIndex(index,videoId){
      this.switchVideo(videoId)
      this.index = index
    }
  },
  inject: [
    "detailList",
    "switchVideo"
  ]
}
</script>

<style scoped>
/*中部 视频选中样式*/
.SectionSelector_active__dySMp {
  color: #00AEEC;
}
.hover_blue:hover {
  color: #4daae4;
}
/*横排样式 当前播放视频样式*/
.currentColor {
  color: #00AEEC;
}

/* 盒子样式 视频被选中样式*/
.numberListItem_select__WgCVr {
  background-color: #00a1d6;
  color: #fff;
}

.eplist_ep_list_wrapper__Sy5N8 {
  position: relative;
  background-color: #F1F2F3;
  border-radius: 6px;
  margin-bottom: 15px;
}

.eplist_list_title__48o_y {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  height: 44px;
  padding: 0 16px;
}

.eplist_left_wrap__UFyXT {
  font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, Helvetica, Arial, PingFang SC, Hiragino Sans GB, Microsoft YaHei, sans-serif;
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 100%;
}

.eplist_left_wrap__UFyXT h4 {
  padding: 0;
  font-size: 16px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  margin-right: 9px;
  display: block;
  margin-block-start: 1.33em;
  margin-block-end: 1.33em;
  margin-inline-start: 0;
  margin-inline-end: 0;
}

.eplist_ep_list_progress__MXZG2 {
  display: block;
  margin-left: 5px;
  font-size: 12px;
  color: #61666D;
}

.eplist_right_wrap__WaBpF {
  display: flex;
  flex-direction: row;
}

.modeChangeBtn_wrap__xihUg {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.modeChangeBtnspan {
  overflow: hidden;
  width: 24px;
  height: 24px;
}

.eplist_ep_list_order__TfnoF {
  width: 24px;
  height: 24px;
  margin-left: 17px;
  cursor: pointer;
}

.imageList_wrap___f73Z {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  position: relative;
  padding: 8px 10px 2px 16px;
  max-height: 350px;
  overflow: auto;
}

.imageListItem_wrap__o28QW {
  width: 100%;
  margin-bottom: 12px;
  height: 59px;
  cursor: pointer;
}

.imageListItem_wrap__o28QW a {
  height: 100%;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
}

.imageListItem_coverWrap__evIUp {
  position: relative;
  margin-right: 10px;
  width: 106px;
  height: 60px;
  border-radius: 4px;
  overflow: hidden;
  background: #C9CCD0 url(https://s1.hdslb.com/bfs/static/ogv/video2/_next/static/media/img_loading.6d24ade7.png) 50% no-repeat;
  background-size: 50%;
  flex-shrink: 0;
}

.image_ogv_weslie_common_image {
  width: 100%;
  height: 100%;
}

.imageListItem_badge__F9tZQ {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 0 4px;
  height: 18px;
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  border-radius: 2px;
  /*background-color: #999;*/
}

.imageListItem_title__MC0fG {
  font-size: 14px;
  line-height: 18px;
  min-height: 18px;
  max-height: 36px;
  font-weight: 500;
  align-self: flex-start;
  transition: color .3s ease;
}

.imageListItem_shortTitle__yV5mg {
  margin-bottom: 0;
  display: -webkit-box;
  white-space: normal;
  word-wrap: break-word;
  text-overflow: ellipsis;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.imageListItem_longTitle__I6il0 {
  margin: 5px 0 0 0;
  display: -webkit-box;
  white-space: normal;
  word-wrap: break-word;
  text-overflow: ellipsis;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

/*视频第二样式部分*/
.numberList_wrapper___SI4W {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  position: relative;
  padding: 7px 10px 6px 16px;
  overflow-y: auto;
  max-height: 350px;
}

.numberListItem_number_list_item__T2VKO {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  padding: 0 4px;
  border: 1px solid transparent;
  background-color: #ffffff;
  margin-right: 8px;
  margin-bottom: 8px;
}

.numberListItem_number_list_item__T2VKO:hover {
  background-color: #DFF6FD;
  border: 1px solid #00AEEC;
}

.numberListItem_number_list_item__T2VKO a {
  line-height: 56px;
  text-align: center;
}

.numberListItem_title__LNXrS {
  width: 56px;
  height: 56px;
  display: block;
  font-size: 12px;
  color: #222;
  font-family: xx-bin, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.numberListItem_badge__Ex_1n {
  border-radius: 0 6px;
  position: absolute;
  top: -1px;
  right: -1px;
  padding: 0 3px;
  height: 19px;
  line-height: 19px;
  text-align: center;
  color: #fff;
  font-size: 12px;
}
</style>
